import createPersistedState from 'vuex-persistedstate'
import Cookies from 'js-cookie'
let storage = {
  getItem: key => Cookies.getJSON(key),
  setItem: (key, value) => Cookies.set(key, value, { expires: 3, secure: false }),
  removeItem: key => Cookies.remove(key)
}
export default ({ store }) => {
  createPersistedState({
    paths: ['authInfo', 'hollandTest'],
    storage: storage,
    getState: storage.getItem,
    setState: storage.setItem
  })(store)
}
